home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 25
/
CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso
/
CUCD
/
WWW
/
http
/
www.wirenet.co.uk
/
files
/
Dashboard2.lha
/
Dashboard2
/
AmiTCP
/
bin
/
SendEvents
< prev
next >
Wrap
Text File
|
1998-03-27
|
3KB
|
96 lines
/*
$VER: SendEvents 2.0 (26.3.98)
(c) Neil Bothwick
Check if there are any outstanding events and if
so send them.
This version works with multiple systems
*/
/* ;;;Change these to suit your setup */
MaxTries = 5 /* Maximum number of retries */
Logging = 1 /* Turn on logging, only use with Thor 2.3 and above */
LogFile = 'UUSpool:Info.log'
;;;
/* ;;;Don't change anything below here */
parse upper arg args
if args = FTP then DoFTP = 1
EVE_DOWNLOAD = 4
EVE_UPLOAD = 5
address command
;;;
/* ;;; Execute PreSend script */
if exists('Wirenet:UserScripts/PreSend') then address command 'Wirenet:UserScripts/PreSend'
;;;
/* ;;;Load libraries and get system information */
if ~show('p', 'BBSREAD') then do
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
address BBSREAD
drop Systems.
'GETBBSLIST stem SYSTEMS'
if Logging = 1 then TempLog = 'T:Send.'||time(s)
;;;
/* ;;;Send events for each relevant system */
do i = 1 to Systems.COUNT
address BBSREAD
SystemName = Systems.i
drop SysData.
'GETBBSDATA "'SystemName'" stem SYSDATA'
if left(SysData.BBSTYPE,3) ~= 'TCP' then iterate
address command
CmdStr = GetVar('Thor/ThorPath')||'bin/SendTCP BBSNAME' SystemName 'MAILSERVER' getclip('SMTPServer') 'NEWSSERVER' getclip('NewsServer') 'PUBSCREEN ""'
if Logging = 1 then CmdStr = CmdStr 'LOGFILE' TempLog
do Try = 1 to MaxTries
if ActiveEvents('NOFTP') > 0 then do
CmdStr 'NOFTP'
end
If ActiveEvents('NOFTP') > 0 then say 'SendTCP failed for' SystemName
end
/* Do FTP after mail and news */
if getclip('AminetServer') > '' then CmdStr = CmdStr 'AMINETSERVER' getclip('AminetServer')
if getclip('DownloadDir') > '' then CmdStr = CmdStr 'AMINETDLDIR' getclip('DownloadDir')
if getclip('AminetRoot') > '' then CmdStr = CmdStr 'AMINETBASEDIR' getclip('AminetRoot')
if getclip('GetReadme') = 1 then CmdStr = CmdStr 'GETREADME'
do Try = 1 to MaxTries
if ActiveEvents() > 0 then do
CmdStr
end
end
If ActiveEvents() > 0 then say 'SendTCP failed for' SystemName
end
if Logging = 1 then address command 'run >NIL: ShowLog' TempLog req log info
;;;
exit
/* ;;;Check for active events in this system */
ActiveEvents:
arg evtype
address BBSREAD
ActiveCount = 0
GETBBSDATA SystemName SystemData
do EventNo=SystemData.FIRSTEVENT to SystemData.LASTEVENT
drop EventData.
drop EventTags.
READBREVENT '"'SystemName'"' eventnr EventNo datastem EventData tagsstem EventTags
EventFlags = c2x(EventData.FLAGS)
if EventFlags = 0 | EventFlags = 8 then do
if evtype = 'NOFTP' then do
if EventData.EVENTTYPE ~= EVE_DOWNLOAD & EventData.EVENTTYPE ~= EVE_UPLOAD then return 1
end
else return 1
end
end
address command
return 0
;;;